Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use alloy genesis now #6135

Merged
merged 5 commits into from
Jan 20, 2024
Merged

Conversation

supernovahs
Copy link
Contributor

No description provided.

@supernovahs
Copy link
Contributor Author

@mattsse
2 issues

1

https://github.com/supernovahs/reth/blob/422868366cd4f968defa10ceeda17f78097e3f23/crates/net/network/tests/it/geth.rs#L100-L102 needs ethers genesis

impl From<ethers_core::utils::Genesis> for Genesis {
/// This conversion function extracts and maps specific fields from the input `genesis` to
/// create a new `Genesis` instance
fn from(genesis: ethers_core::utils::Genesis) -> Genesis {
Genesis {
config: genesis.config.into(),
nonce: genesis.nonce.as_u64(),
timestamp: genesis.timestamp.as_u64(),
gas_limit: genesis.gas_limit.as_u64(),
difficulty: U256::from_limbs(genesis.difficulty.0),
mix_hash: genesis.mix_hash.0.into(),
coinbase: genesis.coinbase.0.into(),
extra_data: genesis.extra_data.0.into(),
base_fee_per_gas: genesis.base_fee_per_gas.map(|fee| fee.as_u64()),
// TODO: if/when ethers has cancun fields they should be added here
excess_blob_gas: None,
blob_gas_used: None,
alloc: genesis
.alloc
.iter()
.map(|(addr, account)| (addr.0.into(), account.clone().into()))
.collect(),
}
}
}

2

One of the tests need Genesis Allocator

let mut allocator = GenesisAllocator::default().with_rng(&mut rng);

How do u want to proceed with it ?
Add it back in alloy?

@mattsse
Copy link
Collaborator

mattsse commented Jan 19, 2024

I don't think we need this anymore

@supernovahs
Copy link
Contributor Author

1st issue pending, 2nd resolved

@gakonst
Copy link
Member

gakonst commented Jan 19, 2024

to make it explicit, we want to remove the dependency on ethers genesis

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @supernovahs this is great!

I'll get rid of the compile errors, I think I know how to fix

@mattsse mattsse self-assigned this Jan 19, 2024
@mattsse mattsse added the C-debt A clean up/refactor of existing code label Jan 20, 2024
@mattsse mattsse enabled auto-merge January 20, 2024 09:56
@mattsse mattsse added this pull request to the merge queue Jan 20, 2024
Merged via the queue into paradigmxyz:main with commit bf3264b Jan 20, 2024
28 checks passed
shekhirin pushed a commit that referenced this pull request Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-debt A clean up/refactor of existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants